/*
 * @Author: TJN tjn@246@126.com
 * @Date: 2024-06-26 09:11:43
 * @LastEditors: TJN tjn@246@126.com
 * @LastEditTime: 2024-06-27 09:26:51
 * @FilePath: \hdcms-nest\src\upload\upload.controller.ts
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */
import { Controller, Post, UploadedFile, UseGuards } from '@nestjs/common';
import { UploadService } from './upload.service';

import { AuthGuard } from '@nestjs/passport';
import { UploadDecorator } from './upload.decorator';

@Controller('upload')
export class UploadController {
  constructor(private readonly uploadService: UploadService) {}

  @Post()
  @UploadDecorator('image')
  @UseGuards(AuthGuard('jwt'))
  uploadFile(@UploadedFile() file: Express.Multer.File) {
    return this.uploadService.uploadFile(file);
  }
}
